<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> 
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"  />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="screen-orientation" content="portrait">
<title>行骑网</title>
<!--{~ui('loader')->css('xiuche')}-->

<script type="text/javascript">
var thisSiteURL = 'http://m.xq517.com/';
var tuangou_str = '特卖';
</script>
<!--{~ui('loader')->js('@jquery')}-->
{if !$a_b_loc}
<script src="http://api.map.baidu.com/components?ak=nbZYk6ZZiBm3hwqNYzYRq5z6&v=1.0"></script>
{/if}
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=nbZYk6ZZiBm3hwqNYzYRq5z6"></script>

</head>

<header class="w-header">
     <a class="arrow-left" href="http://m.xq517.com"></a>
                 
					
                    <a href="/" class="home" ></a>
                    <div class="text">行骑网</div>

</header>

<body id="index">
<div id="over" class="over"></div>
<div id="layout" class="layout"><img src="/static/images/loading.gif" /></div>  
<section class="current-weizhi">
<div class="location-tip" >
<span class="tip-text">定位失败,不准?试试手动定位!</span>
<span class="tip-icon" onClick="openMap()">手动定位</span>
</div>
{if $a_b_loc}
<div class="location-address" >
<span class="tip-text" id ="tip-address">定位中...</span>

</div>
{else}
<lbs-geo id="geo" city="" ></lbs-geo>
{/if}

</section>
<div style="padding:10px;border:1px solid gray;display:none" id="allmap"></div>
<div class="deal-btn" style="display:none;">
<a id="send_location" href="javascript:void(0)" onClick="send_loc()" style="float:left;">提交位置</a><a id="cancel" href="javascript:void(0)" onClick="cancel_loc()" style="float:right;">返回</a>
</div>
<div class="content" id='content'>
<section class="goods-list-title">最近修车点</section>
<div class="v3">
  <ul class="common-item" id="listBoby">
  </ul>
 </div>
</div>
<script>
{if $a_b_loc}
$(document).ready(function() {
	a_b_loc = 1;
	var lacation = {$lon} + "," + {$lat};
	pt_lng = {$lon};
	pt_lat = {$lat};
	var gc = new BMap.Geocoder();
	gc.getLocation(new BMap.Point(pt_lng, pt_lat),
	function(rs) {
		var addComp = rs.addressComponents;
		var address = addComp.city + addComp.district + addComp.street + addComp.streetNumber;
		$("#tip-address").html("当前位置: "+address);		
	});
	getLbs(lacation, 1);
	
});
{else}
$(document).ready(function() {
	
	var mapElement = document.getElementById('geo');
	mapElement.addEventListener("geostart",
	function(evt) {
		$(".change-loc").remove();
	})
	 mapElement.addEventListener("geosuccess",
	function(evt) {
		$("#over").css("display", "none");
		$("#layout").css("display", "none");
		var obj = evt.detail.coords;
		var lacation = obj.lng + "," + obj.lat;
		pt_lng = obj.lng;
		pt_lat = obj.lat
		 getLbs(lacation, 0);
	});
	mapElement.addEventListener("geofail",
	function(evt) {
		$("#over").css("display", "none");
		$("#layout").css("display", "none");
		$('#listBoby').html("<li class='single_item'><div class='item-name'> <h2>自动定位失败,您可以试试手动定位</h2></div></li>");
	});
});
{/if}
</script>
<!--{~ui('loader')->js('xiuche')}-->
<!--{template "wap_footer"}-->
{if !$a_b_loc}
<script type="text/javascript" src="http://int.dpool.sina.com.cn/iplookup/iplookup.php? 
format=js"></script> 	
{/if}
</body>
</html>		